package com.xiaomaoguai.cloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import com.xiaomaoguai.cloud.entity.User;

/**
 * @FileName: UserConsumerController.java
 * @Author :WeiHui.Zhang
 * @Data : 2016年11月11日 上午11:21:57
 * @Version:V1.00
 */
@RestController
public class UserConsumerController {

	@Autowired
	private RestTemplate restTemplate;

	@GetMapping("/simple/{id}")
	public User getUser(@PathVariable Long id) {
		return restTemplate.getForObject("http://localhost:7901/simple/" + id, User.class);
	}
}
